﻿<%@ codepage=65001%><% 'UTF-8%>


<% '校验待注册用户名是否冲突%>
<!--#include file="../Include/Common.All.asp"-->
<!--#include file="../Include/Conn.asp"-->
<% call OpenConn%>

<!--#include file="../Include/Common.Security.asp"-->
<!--#include file="../Include/MD5.asp"-->
<!--#include file="../Include/JSON_2.0.2.asp"-->



<%

UserName=ReplaceBadChar(Trim(request.Form("value")))
account=ReplaceBadChar(Trim(request.Form("value")))
'UserName="fashioncat"
'UserPassword="fashioncat"


Dim isRepeatName
isRepeatName = False
If (trim(UserName) = ""  ) Then
	isRepeatName = False
Else
	Dim rsObj,strSql
	set rsObj=Server.CreateObject("ADODB.Recordset")
	strSql = "SELECT * FROM PE_User "   & "WHERE UserName='" & UserName & "'  "
	Set rsObj = Conn.Execute(strSql)
	If rsObj.BOF And rsObj.EOF Then
		isRepeatName = False
	Else
		isRepeatName = True
	End If
	rsObj.close
	Set rsObj = Nothing
End If
	
	'定义json对象
	Dim loginObj
	Set loginObj = jsObject()


if isRepeatName = False then
	loginObj("msg") ="&#x606D;&#x559C;&#x60A8;&#xFF0C;&#x8BE5;&#x7528;&#x6237;&#x540D;&#x53EF;&#x4EE5;&#x6CE8;&#x518C;&#xFF01;&#x6210;&#x529F;&#x6CE8;&#x518C;&#x540E;&#xFF0C;&#x7528;&#x6237;&#x540D;&#x5C06;&#x4E0D;&#x80FD;&#x66F4;&#x6539;&#x4E14;&#x4E0D;&#x80FD;&#x6CE8;&#x9500;&#x3002;"'' "恭喜您，该用户名可以注册！成功注册后，用户名将不能更改且不能注销。"
	loginObj("success") = "false"
else
	loginObj("msg") ="&#x5BF9;&#x4E0D;&#x8D77;&#xFF0C;&#x8BE5;&#x7528;&#x6237;&#x540D;&#x5DF2;&#x7ECF;&#x88AB;&#x6CE8;&#x518C;&#xFF01;"'' 
	loginObj("success") = "true"
end if
'输出json对象
loginObj.Flush
''Response.Write strSql

call CloseConn

%>
